package com.itheima;

import com.itheima.dao.OrderDao;
import com.itheima.dao.UserDao;
import com.itheima.factory.UserDaoFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppForInstanceUser {
    public static void main(String[] args){
      /*  //1.创建工厂对象
        UserDaoFactory userDaoFactory =new UserDaoFactory();

        //通过实例工厂对象创建对象
        OrderDao orderDao = userDaoFactory.getUserDao();
        orderDao.save();*/



        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

        UserDao userDao = (UserDao) ctx.getBean("userDao");

        userDao.save();


    }
}
